package cn.com.yusys.yusp.mobile.service;

import cn.com.yusys.yusp.commons.mapper.CommonMapper;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.service.CommonService;
import cn.com.yusys.yusp.mobile.repository.mapper.OutStandingAchievementMapper;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 业绩
 *
 * @AUTHOR ZOIE
 */
@Service("outStandingAchievementService")
public class OutStandingAchievementService extends CommonService {

    private static Logger logger = LoggerFactory.getLogger(OutStandingAchievementService.class);
    @Resource
    private OutStandingAchievementMapper outStandingAchievementMapper;

    @Override
    protected CommonMapper getMapper() {
        return null;
    }

    /**
     * 查询今日业绩TOP3
     *
     * @return
     */
    public List<Map<String, Object>> queryAchievementTop3(QueryModel queryModel) {
        List<Map<String, Object>> list = outStandingAchievementMapper.queryAchievementTop3(queryModel);
        return list;
    }

    /**
     * 查询今日业绩列表
     *
     * @return
     */
    public List<Map<String, Object>> queryAchievementList(QueryModel queryModel) {
        // 设置分页查询参数(设置到线程变量中了)
        PageHelper.startPage(queryModel.getPage(), queryModel.getSize());
        List<Map<String, Object>> list = outStandingAchievementMapper.queryAchievementList(queryModel);
        PageHelper.clearPage();
        return list;
    }

    /**
     * 本月绩效统计
     * @param queryModel
     * @return
     */
    public Map<String,Object> queryBusiRank(QueryModel queryModel){
        Map<String,Object> map = outStandingAchievementMapper.queryBusiRank(queryModel);
        return map;
    }

    /**
     * 龙虎榜
     * @param queryModel
     * @return
     */
    public List<Map<String, Object>> queryRankList(QueryModel queryModel) {
        List<Map<String, Object>> list = outStandingAchievementMapper.queryRankList(queryModel);
        return list;
    }

}